package com.xunqi.weixinpar.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2016102400753945";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCv1ari+odS6CHOXXoj2zaaE32ISKBp7w4p7ecknglOO5DPjgmRv4ojjSjvrokyJPX0YehK7kpvmFJGdvhq/OQ48m5+St0wvD1wJzU3QFCgX08+DwgQ5DhoiVuYKSXy2BpRH30QX4Nmu5OZDxmUOaIfmLyKd1kZapqkN0Qf7bAjkCnZcrITf7uP11GBabS4ttCreW0lTfEKZwNx+/2KrI5jOd4YdhHmAZ+a217TzfOBC0Z3VUVIpXn+g5gNlbZY7KbOGfxCapfh7oeP2Hbi7vCUtw6khz34PGsG1QbJCjdf2j6gLWJF8+h6/ldwfCprvtXblzQtxz8ScmJJIN8SGQxTAgMBAAECggEAVG2X/BynVZu4f8pKl2TuttSc9g9JVxQ+DMv6rI5lkXbwdXiSB7Wcsq1Y9p0rqzQsFQfd7fy1KRhOiR8e8OA1BVMC0wlHY9s+9NceqkTrcdXRys6U5OdwXmF15X38hrpVCJbCClaSVYXDvT6O3ak+u0UvYp0j3xxc3HTc9Se/55LJc8I+71oWGNsDZv/xd8B6nqCZimqfv8d0d7WkPliXzznmTe59/TiY9vsQxA0IKhs3bktZ+3AUdPi0Tu8BKuiU8FdRxyzP8N/KW3lZX8d4PI19kxPobEp1m2MtADPPcvZ92/KZ3nkIgu/bxJF5G0YL8LvHS22xuBMiT/zKc83VQQKBgQDZ4FR8jh2SaavPrPbMxttve0XJjYSaflQaLfK445IZrlS8eME9tv+V56IsKVYNdQj0DbEO0EphybZ7lV/5moHJcZD7u4x5DgaenjvSacH+uamE4U+G/uQeN1L55oX4d2dm+nmVfCbC13q0EECQ93NuyATcQ57Sg9tOGH9qYvYKGQKBgQDOmhnLS1JugKhMvThLwB5UaC23F80pCQmq5DfmWVspkijvL8qZcxALl0U9eghg/ml24PqsBJ+PyS2/X2tU236u81P5vO4B8z68TbSNntGRy2L5NfpICkZ8E97J/FCjeDtBc2PlpBAPQDIy2H6Fyx7s7W+W41D19pWQA/3iiaWvSwKBgAY6DBAXO68giAGCbvdBQ6o2+rKc8co8jAjHgWVZU6aaPd+5D8TEwx80pITglY4C50OaVJIYz9dlnWqAxWJr0QPB1CPto0EeboAAA7OqxBmUksyyZ8Ry6nAWoq9zsCZ+uxzNUcY86xqsb9xPjpjWCZ2D5+enoxVfIVhlCNcwhtmZAoGAO59LLFj7W/pzF1pQAcRavF8oOjt7MIl0KcYcv7Qv08pjV8uB+1CyY7Xu/HPYMS2af/0jOjtHVPZo5l6CGgYSBCkipeK5CQUKqMr//RLFRf7c/DBwnxOgDbSqSb4wA0zyRMwpGx+CpvQOyI+jy7a3oQZQesn1FlZoCRytyw+QKgsCgYAeQ22oAx/1vmplc1jGOTPbMXV1DdTlPgHl3yzxLhNroF91Qg2dFxV4octecb0bt3qYucfbjBW9mYMMHpzIk7bZDTgJ4tXxVcaxP9ck09fD2D1p1wJEJ3hsmMOL3J8h0Ded+gXxY68F8OlQGT8oJBxdnwXRtLXdupc7lIJRZRKEsg==";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAgdQGWDzuzcfrUZ9WcDdsXTNoWKUch98WWSu3ZNnhnt9FVYVdDd8EwkAIH4BZ5lUVkyg3xa+BJEiO9SYlCFieW4I9410edqDHnkcEz3Tsh1XaQy9BRHhv4RclyWTSsppjefmo1et++VYCZblrLfLEnQvpnysvoivIQILVKcIAG3LVL2k+7E5jTNXAf5gOJKV835pnSJHyW0uIhRgoz1dBIS2ICUK7Mg18zGUk0kIoUO8YFyyeV0mpcuAwm4yReRpPKit/6Rl/3OF5tholcclXOZS6MW54ajPYro/tDHFny/tI6FkwgD6Pyq84ib3/XysPthVx0Zyel4tWx6sdQBsJaQIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问 //todo:
	public static String notify_url = "https://lxjlry.mynatapp.cc/AliPay/NotifyUrl";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问 //todo:
	public static String return_url = "https://lxjlry.mynatapp.cc/AliPay/ReturnUrl";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

